package com.onstar.cn.api.v2;

import com.onstar.cn.api.framework.ClazzInjectUtils;
import com.onstar.cn.api.framework.annotation.Path;
import com.onstar.cn.api.framework.annotation.PathParams;
import com.onstar.cn.api.framework.annotation.RequestMapping;
import com.onstar.cn.framework.network.entity.RequestEntity;

/**
 * MSP V2版本修改
 * @author  7828wc
 */
@Path("/msp/api/v3/user")
public class UsersService {

	private String serverURL;

	/**
	 * @author 7828wc
	 * @date 2015年12月16日 下午3:01:47
	 */
	public UsersService(String serverURL) {
		this.serverURL = serverURL;
	}

	/**
	 * @param @param requestEntity
	 * @param @return 设定文件
	 * @return RequestEntity 返回类型
	 * @throws
	 * @Title: swichVehicle
	 * @Description: 切换车辆
	 */
	@RequestMapping("/subscriber/{subscriberID}/accounts/vehicles/swich")
	public RequestEntity swichVehicle(RequestEntity requestEntity,
			@PathParams(value = "subscriberID") String subscriberID, String accountID, String vin) {
		if (requestEntity == null) {
			requestEntity = new RequestEntity();
		}
		String url = ClazzInjectUtils
				.injectUrl(getClass(), "swichVehicle", requestEntity, subscriberID, accountID, vin);
		requestEntity.setUrl(serverURL + url + "?account_id=" + accountID + "&vin=" + vin);
		return requestEntity;
	}

	/**
	 * @param @param requestEntity
	 * @param @return 设定文件
	 * @return RequestEntity 返回类型
	 * @throws
	 * @Title: swichVehicle
	 * @Description: 切换车辆
	 */
	@RequestMapping("/subscriber/accounts/{accountID}/vehicles/info3/swich")
	public RequestEntity swichVehicle_New(RequestEntity requestEntity,
									  @PathParams(value = "accountID") String accountID) {
		if (requestEntity == null) {
			requestEntity = new RequestEntity();
		}
		String url = ClazzInjectUtils
				.injectUrl(getClass(), "swichVehicle_New", requestEntity, accountID);
		requestEntity.setUrl(serverURL + url);
		return requestEntity;
	}
}
